package com.ac.app.web.action.pick;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionMapping;

import com.caac.core.config.QueryClass;
import com.caac.core.util.Page;
import com.caac.core.web.action.BasePageViewAction;
import com.caac.core.web.action.PageViewForward;
import com.caac.core.web.form.BaseForm;
import com.ac.app.dm.PickLog;
import com.ac.app.web.form.PkLogSearchForm;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright AgileCentury 2008</p>
 * <p>Company: AgileCentury </p>
 * @author <a href="mailto:ac@agilecentury.com">Agile</a>
 * @version 1.0
 */

public class SearchPkLogAction extends BasePageViewAction {
	private static final String	QUERY_NAME	= "pkLogQuery";
	private static final String	ORDER_NAME	= "pkLogOrder";
	private static final String	VIEW_NAME	= "pkLogView";
	
	protected PageViewForward doPageViewExecute(ActionMapping mapping,
			BaseForm form, HttpServletRequest request,
			HttpServletResponse response, int pageNo, int pageSize)
			throws Exception {
		PkLogSearchForm myForm = (PkLogSearchForm) form;
		QueryClass qc = getQuery(QUERY_NAME);

        Page page = new Page(getBaseManager().getCount(PickLog.class, qc, myForm,
				myForm.isAnd()), pageNo, pageSize);
		List dmList = getBaseManager().getObjects(PickLog.class, qc, myForm,
				myForm.isAnd(), getOrder(ORDER_NAME), page);
        
		return new PageViewForward(forward(mapping), dmList, page,
				getSelViewProps(VIEW_NAME), null, null);
	}
}

